package com.example.backend.mapper;

import com.example.backend.entity.Company;
import com.example.backend.entity.Warehouse;
import com.example.backend.entity.Port;
import com.example.backend.dto.CompanyPortInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface CompanyMapper {
    int insert(Company company);
    Company selectById(Long id);
    List<Company> selectAll();
    int update(Company company);
    int deleteById(@Param("id") Long id);
    List<Company> selectByPortId(Long portId);
    List<CompanyPortInfo> selectCompaniesWithRemainingWeightByPortId(Long portId);
    List<CompanyPortInfo> selectCompaniesByPortIdSimple(Long portId);
    List<Warehouse> selectWarehousesByCompanyId(Long companyId);
    int insertCompanyWarehouse(@Param("companyId") Long companyId, @Param("warehouseId") Long warehouseId);
    int deleteCompanyWarehouse(@Param("companyId") Long companyId, @Param("warehouseId") Long warehouseId);
    List<Port> selectPortsByCompanyId(Long companyId);
    int insertCompanyPort(@Param("companyId") Long companyId, @Param("portId") Long portId);
    int deleteCompanyPort(@Param("companyId") Long companyId, @Param("portId") Long portId);
    List<CompanyPortInfo> selectPortsWithRemainingByCompanyId(Long companyId);
} 